package com.myfum.mobile.tetris.data.shapes
{
	import com.myfum.mobile.tetris.data.cubes.DropingCubeData;

	public class SLeftShapeData extends ShapeData
	{
		private const H:int = 0;
		private const V:int = 1;
		public function SLeftShapeData()
		{
			super();
		}
		
		override public function rotate():void{
			var ox:int = cubes[1].x;
			var oy:int = cubes[1].y;
			if(getDirection() == H){
				cubes[0].x = ox;
				cubes[0].y = oy - 1;
				cubes[2].x = ox - 1;
				cubes[2].y = oy;
				cubes[3].x = ox - 1;
				cubes[3].y = oy + 1;
			}else{
				cubes[0].x = ox - 1;
				cubes[0].y = oy;
				cubes[2].x = ox;
				cubes[2].y = oy + 1;
				cubes[3].x = ox + 1;
				cubes[3].y = oy + 1;
			}
		}
		
		private function getDirection():int{
			if(cubes[0].y == cubes[1].y){
				return H;
			}else{
				return V;
			}
		}
	}
}